package orest.front.expert;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

 



import net.ssta.common.Constants;
import net.ssta.core.base.ServletBase;
import net.ssta.core.db.PagingInfo;
import net.ssta.core.db.RecordSet;
import net.ssta.core.db.Record;
import net.ssta.core.web.RequestKit;

public class ExpertServlet extends ServletBase {

	protected void defaultAction(HttpServletRequest request, HttpServletResponse response) throws IOException
	{
			System.out.println("UserNeedsServlet default Action");
	}
	
    
    
    
    /**
     * test
     *  获取科研专家列表
     * @param request
     * @param response
     */
    public void getExpertList(HttpServletRequest request,
        HttpServletResponse response)
    {
        try
        {
        	RequestKit requestKit = (RequestKit) request.getAttribute("RequestKit");
        	ExpertHandler handler = new ExpertHandler();
            RecordSet rset = handler.getExpertList(requestKit);
            
            appendString(rset.getJsonString());
        }
        catch (Exception e)
        {
        	e.printStackTrace();
        }
    }
    
    
    /**
     * test
     *  获得推荐专家列表
     * @param request
     * @param response
     */
    public void getRecommendExpertList(HttpServletRequest request,HttpServletResponse response)
    {
        try
        {
        	RequestKit requestKit = (RequestKit) request.getAttribute("RequestKit");
        	ExpertHandler handler = new ExpertHandler();
            RecordSet rset = handler.getRecommendExpertList(requestKit);
            
            appendString(rset.getJsonString());
        }
        catch (Exception e)
        {
        	e.printStackTrace();
        }
    }
    
}
